package com.example.forjava.encrypt.io;


public abstract class FileWriteDemo {

	private String fileName;
	
	private String fileLine;
	
	private int lineNum;
	
	public FileWriteDemo(String fileName, int lineNum) {
		this.fileName = fileName;
		this.lineNum = lineNum;
		this.fileLine = "123456789012345678901234123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789";
//		this.fileLine = "�й�";
	}
	
	public void write() {
		SimpleLog.info(this, "begin to write...");
		long startTime = System.currentTimeMillis();
		this.writeInner();
		long endTime = System.currentTimeMillis();
		SimpleLog.info(this, "finish write.");
		SimpleLog.info(this, "duration is: "+(endTime - startTime));
	}
	
	protected abstract void writeInner();

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	
	public String getFileLine() {
		return fileLine;
	}

	public void setFileLine(String fileLine) {
		this.fileLine = fileLine;
	}

	public int getLineNum() {
		return lineNum;
	}

	public void setLineNum(int lineNum) {
		this.lineNum = lineNum;
	}
	
}
